package com.enjoyor.soa.traffic.rest.efoms.dubbo.invoke;

import com.alibaba.dubbo.config.annotation.Reference;
import com.alibaba.fastjson.JSONObject;
import com.enjoyor.soa.traffic.api.serverpush.server.dubbo.DubboServerPushService;
import com.enjoyor.soa.traffic.util.pojo.ResultPojo;
import org.springframework.stereotype.Component;

@Component
public class DubboServerPushServiceInvoke {

    @Reference(timeout = 3000, cluster = "broadcast")
    private DubboServerPushService dubboServerPushService;

    public ResultPojo getJsPath() {
        return dubboServerPushService.getJsPath();
    }

    public ResultPojo pushMessage(String namespace, JSONObject message) {
        return dubboServerPushService.pushMessage(namespace, message);
    }

    public ResultPojo pushMessage(String namespace, String event, JSONObject message) {
        return dubboServerPushService.pushMessage(namespace, event, message);
    }

}
